/*
 * Copyright 2008 Carnegie Mellon University
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, 
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
function init( lang ) {
  loadHeaderSub( lang );
  loadMessages( lang );
}

function applyPermission() { 
  // enable buttons for participants (+ organizers and admin)
  jQuery.each(['upload','download'], 
    function(index,value) {
      //jQuery bug in 1.6.2 for ie6.
      if (jQuery.browser.msie && jQuery.browser.version=="6.0") {
        jQuery('#msg_'+value).prop("disabled", false);
      } else {
        jQuery('#msg_'+value).removeAttr("disabled");
      }
    }
  );

  // enable buttons for topic developer / assessor  (+ organizers and admin)
  if (privilege>=30 || isAdmin) {
    jQuery.each(['td','ne','nv','exporter','eval_exporter','he_ir',
                 'he_qa','progress_browser','progress_ir_eval','progress_qa_eval'], 
      function(index,value) { 
        //jQuery bug in 1.6.2 for ie6.
        if (jQuery.browser.msie && jQuery.browser.version=="6.0") {
          jQuery('#msg_'+value).prop("disabled", false);
        } else {
          jQuery('#msg_'+value).removeAttr("disabled");
        }
      }
    );
  }
  
  if (privilege>=40 || isAdmin) {
    jQuery.each(['importer','eval_importer'], 
      function(index,value) { 
        //jQuery bug in 1.6.2 for ie6.
        if (jQuery.browser.msie && jQuery.browser.version=="6.0") {
          jQuery('#msg_'+value).prop("disabled", false);
        } else {
          jQuery('#msg_'+value).removeAttr("disabled");
        }
      }
    );
  }
}